<?php

require_once 'portal.php';
include_once 'log_text.php';


if ($input) {
  output(get_param($input));
}

output(get_param($input));

function get_param($name) {
  log_text("get_param('{$name}')");
  if (isset($name) && strlen($name) >= 4) {
    $sql = "SELECT `value` FROM `pims_config_params` WHERE `name` = '{$name}'";
    $res = exec_sql($sql);
    if ($res) {
      if (IS_DEBUG) {
        log_text(stringify($res[0]['value']));
      }
      return json_decode($res[0]['value']);
    }
  }
}
